<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="./lib/mui/js/vue.min.js"></script>
</head>

<body>
  <div id="app">
    <com1 @func='show'></com1>
  </div>

  <template id="templ">
    <div>
      <h1>这里是子组件</h1>
      <input type="button" value="子组件按钮" @click='myclick'>
    </div>
  </template>

  <script>

    var com1 = {
      template: '#templ',
      methods: {
        myclick(){
          console.log('ok'),
          this.$emit('func')
        }
      }
    }

    var vm = new Vue({
      el: '#app',
      data: {},
      methods: {
        show(){
          console.log('这里是父组件的方法');
        }
      },
      components: {
        com1
      }
    });
  </script>
</body>

</html>